package fejezet20;

import java.awt.Graphics;
import java.awt.Image;                                  //1
import java.net.MalformedURLException;
import java.net.URL;                                    //2
import javax.swing.JApplet;

public class JavaLogo extends JApplet {
  private Image kép;                                    //3

  @Override
  public void init() {
    URL url;
    try {
    url=new URL("http://upload.wikimedia.org/wikipedia/"+
                  "en/thumb/3/39/Java_logo.svg/"+
                  "100px-Java_logo.svg.png");           //4
//    url=new URL("file:///C:/JavaPT/JavaPT/images/"+
//                  "100px-Java_logo.svg.png");         //5
      kép=getImage(url);                                //6
    }
    catch(MalformedURLException e) {                    //7
      getAppletContext().showStatus(
        "Hiba! Nincs meg a kép!");                      //8
    }
  }

  @Override
  public void paint(Graphics g) {
    g.drawImage(kép, 100, 50, 104, 151, this);          //9
  }
}